package cn.virens.service.impl.platform.wxmp.menus;

import org.springframework.stereotype.Service;

import cn.virens.database.common.BaseServiceImpl;
import cn.virens.database.common.mapper.ExampleWrapper;
import cn.virens.database.mysql.mapper.wxmp.WxmpMenusMatchruleMapper;
import cn.virens.database.mysql.model.wxmp.WxmpMenusMatchrule;
import cn.virens.service.inter.platform.wxmp.menus.WxmpMenusMatchruleService;

/**
 * 按钮规则 - wxmp_menus_matchrule
 *
 * @author Virens
 * @since  2019-11-09
 */
@Service
public class WxmpMenusMatchruleServiceImpl extends BaseServiceImpl<WxmpMenusMatchruleMapper, WxmpMenusMatchrule> implements WxmpMenusMatchruleService {

	public WxmpMenusMatchruleServiceImpl() {
		super(WxmpMenusMatchrule.class);
	}

	@Override
	public int deleteByUuid(String uuid) {
		ExampleWrapper example = ExampleWrapper.of(clazz);
		example.and().andEqualTo("uuid", uuid);

		return mBaseMapper.deleteByExample(example);
	}

	@Override
	public WxmpMenusMatchrule selectByUuid(String uuid) throws Exception {
		ExampleWrapper example = ExampleWrapper.of(clazz);
		example.and().andEqualTo("uuid", uuid);

		return mBaseMapper.selectOne(example);
	}
}
